import Vue from 'vue';
import VueRouter from 'vue-router';
import Code from '../views/Code/index.vue';
import Im from '../views/Im/index.vue';
import Color from '../views/Color/index.vue';
import More from '../views/More.vue';
import File from '../views/File/index.vue';
import Layout from '../views/Layout.vue';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect: '/code',
    children: [
      {
        path: '/code',
        name: 'Code',
        component: Code,
      },
      {
        path: '/color',
        name: 'Color',
        component: Color,
      },
      {
        path: 'file',
        name: 'File',
        component: File,
      },
      {
        path: '/im',
        name: 'Im',
        component: Im,
      },
      {
        path: '/more',
        name: 'More',
        component: More,
      },
    ],
  },
];

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes,
});

export default router;
